//青蛙类
//1.生成青蛙
//2.更换青蛙的皮肤和动画
//3.更新青蛙的动画，朝向和移动位置
//4.更改为网络青蛙，更改移动模式

module control {
	export class frogNet extends frog {
		public constructor(Game: any) {
			super(Game);
			this.gamePanleHandle = Game.displayContainer;
			this.m_frogMgr = Game;
		}
		protected detalTimeOfMove;
		/**断线惩罚 */
		public ispunish = false;
		/**是有颜色 */
		public iscolour = true;
		/**表情持续时间 */
		public eyetime = -1;
		/**墨镜持续时间 */
		public eyetimeMojing = -1;
		/**青蛙眼睛 */
		public qineyer: number = 1;
		/**青蛙 */
		public size1;
		/**青蛙大小 */
		public size;
		/**判断玩家升级所需的值 */
		protected frogUpdatePeroidValue = 100;
		/**游戏界面的句柄 */
		protected gamePanleHandle;
		/**青蛙管理句柄 */
		protected m_frogMgr;
		/**保存玩家的id */
		public userid;
		/**保存玩家的名字 */
		public username;
		/**玩家的类型 */
		public type;
		/**玩家的等级--小级 */
		public minLevel;
		/**玩家的等级--大级 */
		public mainLevel;
		/**舌宽 */
		public tongueWide: number;
		/**分数 */
		public grade: number;
		/**判断青蛙是否存活，或者是否被使用 */
		public isUsed;
		/**判断青蛙在队列中的位置*/
		public frogId;
		/**玩家动画显示对象   可用此对象控制玩家动画 */
		public frogAniamtionDis;
		/**青蛙拖尾 */
		public frogTrai;
		/**青蛙名字 用于显示 */
		public frogName: eui.Label;
		/**玩家是否已连线 */
		public frogIsHadLine: boolean;
		public deathDate: any;
		public roomID: any;
		/**青蛙舌长 */
		public frogLineLength = 0;
		/**线快断掉了 */
		protected tu: eui.Image = new eui.Image();
		/**护盾外 */
		protected shieldOuter: eui.Image = new eui.Image();
		/**护盾内 */
		protected shieldInside: eui.Image = new eui.Image();
		/**玩家装饰 */
		protected shipin: eui.Image = new eui.Image();
		protected shipin_1: eui.Image = new eui.Image();
		protected shipin_2: eui.Image = new eui.Image();
		protected shipin_3: eui.Image = new eui.Image();
		protected shipin_4: eui.Image = new eui.Image();
		protected shipin_5: eui.Image = new eui.Image();
		/**击杀表情 */
		protected shipin1: eui.Image = new eui.Image();
		/**粒子层 */
		protected tralingLayer: egret.Sprite = new egret.Sprite();
		/**道具效果 */
		public effectOfProps: eui.Image = new eui.Image();
		/**连杀数 */
		protected killNum = 0;
		/**帧动画层 */
		protected ClipLayer: egret.Sprite = new egret.Sprite();
		/**青蛙身上出现冰块图片*/
		protected ice2: eui.Image = new eui.Image();
		/** 舔到异色青蛙眼睛两边变化-头上的黑线*/
		protected heixian: eui.Image = new eui.Image();
		/** 舔到异色青蛙眼睛两边变化-头顶的汗*/
		protected han: eui.Image = new eui.Image();
		/** 舔到异色青蛙眼睛内变化*/
		protected eyeLeft: eui.Image = new eui.Image();
		/** 舔到异色青蛙眼睛内变化-右眼*/
		protected eyeRight: eui.Image = new eui.Image();
		/** 舔到异色青蛙眼睛内变化-tween动画的变化*/
		protected eyeLR: eui.Image = new eui.Image();
		/**显示道具效果-状态图片 */
		protected zhuangtai_1: eui.Image = new eui.Image();
		/**添加碰撞是左右两侧的波纹(bowen)-右侧 */
		protected bwRight: egret.Bitmap = new egret.Bitmap();
		/**添加碰撞是左右两侧的波纹(bowen) -左侧*/
		protected bwLeft: egret.Bitmap = new egret.Bitmap();
		/**判断青蛙的速度*/
		public distanceMax = 1;
		public targetPost: egret.Point;
		protected myPos: egret.Point;
		protected isborn = false;
		public speed: number = 5;
		public targetDir: egret.Point;
		//记录目标位置，只有到了目标位置，才停止
		public targetPoint: egret.Point;
		//记录上次的位置，只有上次的目标和本次的目标不同，才改变位置
		public lastTargetPoint: egret.Point;
		//记录自己的位置的临时变量，只有上次的目标和本次的目标不同，才改变位置
		public curPoint: egret.Point;
		public lastlevel;
		/**等级 */
		public level: number;
		public ismoving = false;
		/**曲线终点位置 */
		public pointOver: egret.Point;
		/**是否可以移动 */
		public canMove = true;
		//根据逻辑帧判断自己何时到达
		public timeStamp;
		/**当前道具效果  防止一直加载 */
		public nowPropsType = [-1, -1, -1, -1, -1, -1, -1, -1, -1];
		/**左眼 */
		protected leftEye: egret.Bitmap;
		/**右眼 */
		protected rightEye: egret.Bitmap;
		public init(index) {
			this.type = 0;
			this.mainLevel = this.GetAttributesByGrade(0).mainType;
			this.minLevel = this.GetAttributesByGrade(0).minorType;
			this.anchorOffsetX = this.width / 2;
			this.anchorOffsetY = this.height / 2;

			this.size1 = serverConfig.config.size;
			this.targetDir = egret.Point.create(0, 0);
			this.targetPoint = egret.Point.create(0, 0);
			this.curPoint = egret.Point.create(0, 0);
			this.lastTargetPoint = egret.Point.create(0, 0);
			this.loadRes();
			this.gamePanleHandle.addChild(this.tralingLayer);
			this.frogAniamtionDis = meterAanimation.getInstance().GetDragonAnimation(1);
			this.addChild(this.frogAniamtionDis);
			FrogReloadingSystem.GetInstance().Reloading(this.frogAniamtionDis, this.type, this.level);
			this.shipinInit();
			this.jisha();
			this.displayShield();

			this.frogLineLength = AIPropsMgr.getInstance().GetAttributesByGrade(0).frogLineLength;
			this.tongueWide = AIPropsMgr.getInstance().GetAttributesByGrade(0).tongueWide;
			this.isUsed = false;
			this.userid = -1;
			this.frogId = index;
			this.visible = false;
			this.gamePanleHandle.addChild(this);
			this.gamePanleHandle.addChild(this.ClipLayer);//添加帧动画层
			this.displayFrogName();
			this.displayEffectOfProps(this.nowPropsType);
			this.targetPost = new egret.Point(0, 0);
			this.myPos = new egret.Point(0, 0);
			this.lastlevel = this.mainLevel;
			this.pointOver = new egret.Point(0, 0);
			this.ismoving = false;
			this.addClip();
			this.all_Image();
			this.EyesInit();
		}
		/**眼睛初始化 */
		protected EyesInit() {
			this.leftEye = new egret.Bitmap();
			this.rightEye = new egret.Bitmap();
			//FrogEyesManage.GetInstance().ChangeEyes(this.frogAniamtionDis, 1, this.leftEye, this.rightEye);
		}
		/**玩家数据更新 */
		public dataUpdata(e: any) {
			this.timeStamp = e.timeStamp;
			this.grade = e.grade;
			this.tongueWide = e.tongueWide;
			this.frogLineLength = e.lineLength;
			this.setTargetPoint(e);
			this.displayOrHideShield(e.NewHandProtect.isProtect);
			this.displayEffectOfProps(e.propStates);
			//根据玩家道具状态切换表情显示 
			// if (e.propStates[2].getPropType != 3) {//道具剪刀状态，只剪一次线，剪后小剪刀消失
			// 	if (this.Clip_shuzu[1].visible == true) {
			// 		this.Clip_shuzu[1].visible = false;
			// 	}
			// }
			//if (e.propStates[0].getPropType == 1) {
			if (this.nowPropsType[0] == daojv["隐身"]) {
				this.frogName.alpha = 0.1;
				this.effectOfProps.alpha = 0.1;
				this.alpha = 0.1;
			} else {
				this.frogName.alpha = 1;
				this.alpha = 1;
				this.effectOfProps.alpha = 0;
			}
			if (this.nowPropsType[3] == daojv["喝酒"]) {
				if (this.qineyer != 4) {
					//FrogEyesManage.GetInstance().ChangeEyes(this.frogAniamtionDis, 4, this.leftEye, this.rightEye);
					this.qineyer = 4;
				}

			}
			else if (this.nowPropsType[7] == daojveff["xuanyun"]) {
				if (this.qineyer != 4) {
					//FrogEyesManage.GetInstance().ChangeEyes(this.frogAniamtionDis, 4, this.leftEye, this.rightEye);
					this.qineyer = 4;
				}
			}
			else {
				if (this.qineyer == 4) {
					var a = 1;
					if (this.ispunish) {
						a = 3;
					}
					
					//FrogEyesManage.GetInstance().ChangeEyes(this.frogAniamtionDis, a, this.leftEye, this.rightEye);
					this.qineyer = a;
				}
			}
			/**判断玩家表情结束 */
			if (this.eyetime != -1 && this.qineyer != 4 && this.qineyer != 3) {
				if (Date.now() - this.eyetime > 500) {
					//FrogEyesManage.GetInstance().ChangeEyes(this.frogAniamtionDis, 1, this.leftEye, this.rightEye);
					this.eyetime = -1;
					this.qineyer = 1;
				}
			}
			/**判断玩家击杀（墨镜）表情结束 */
			if (this.eyetimeMojing != -1) {
				if (Date.now() - this.eyetimeMojing > 1000) {
					this.shipin1.visible = false;
					this.eyetimeMojing = -1;
				}
			}

			/**断线处罚 */
			if (!this.ispunish && e.disconnection_line) {
				this.ispunish = true;
				this.changeFaceEye(3, null);//00修改
				//this.changeClothes.changeClothes(this.frogAniamtionDis, 5, this.level);
				//   console.log("frog name"+e.name+"开始处罚")
			}
			if (this.ispunish && !e.disconnection_line) {
				this.ispunish = false;
				//FrogEyesManage.GetInstance().ChangeEyes(this.frogAniamtionDis, 1, this.leftEye, this.rightEye);
				this.qineyer = 1;
				//	console.log("***********/////////****"+this.type)
				FrogReloadingSystem.GetInstance().Reloading(this.frogAniamtionDis, this.type, this.level);
				//	 console.log("frog name"+e.name+"处罚结束")
			}
			this.frogIsHadLine = e.ishadLine;
			this.DetermineKill(e.killNumber);
			if (this.frogIsHadLine && this.userid == DataProl.account && !DataProl.isEvenLine) {
				DataProl.isEvenLine = true;
			}
			// if (this.frogLineLength < e.lineLength) {
			// 	if (this.userid == DataProl.account && this.frogLineLength != 0) {
			// 		this.killNum++;
			// 		DataProl.struckSeveral++;
			// 		webNetworkMananger.getInstance().gameSceneRec.disPlayKillMan(this.killNum);
			// 	}
			// 	//判断击杀
			// 	if (this.userid != null && this.frogLineLength != 0) {
			// 		this.shipin1.visible = true;
			// 		this.eyetimeMojing = Date.now();
			// 	}
			// 	//AIServer.getInstance().roomInfo.roomUser
			// 	this.bianda(e.lineLength);
			// }
			if (webNetworkMananger.isServerMove) {
				if (e.Death.isDeath) {
					this.frogDied();
					//this.killNum = 0;
				}
			}
			else {
				if (e.death.isDeath) {
					if (e.propStates[3].getPropType == 3)
						this.frogDied();
					this.killNum = 0;
				}
			}
			this.deathDate = e.Death;
			this.dealFrogUpgrade(e);
			//道具五。。变色
			if (webNetworkMananger.getInstance().gameSceneRec.myUser.userSprit.nowPropsType == daojv["色盲"]) {
				//this.changeClothes.isAcritochromacy = true
			}
			// if (this.changeClothes.isAcritochromacy && this.iscolour) {
			// 	this.changeType();
			// 	this.iscolour = false
			// }
			// if (!this.changeClothes.isAcritochromacy && !this.iscolour) {
			// 	this.iscolour = true;
			// 	this.changeType();
			// }
			// if (this.type != e.frogType) {
			// 	this.type = e.frogType;
			// 	this.changeType();
			// }
			// if (this.type != e.frogType) {
			// 	this.type = e.frogType;
			// 	this.changeType();
			// }
			if (this.type != e.frogType) {
				this.type = e.frogType;
				if (!this.ispunish) {
					this.changeType();
					this.nowPropsType[4] = -1;
					//AIUserMgr.getInstance().resetPlayerOnePropStates(e, 4);
				}
			}
			/**防止两个黄色 */
			if (this.userid != DataProl.account && this.frogName.textColor != 0xffffff)
				this.frogName.textColor = 0xffffff;
			this.setFrogPos();
		}
		/**判断击杀 */
		protected DetermineKill(killNumber) {
			//击杀
			if (this.killNum < killNumber) {
				//预留判断击杀眼镜
				if (!this.shipin1.visible) {
					this.shipin1.visible = true;
					this.eyetimeMojing = Date.now();
				}
				//显示击杀特效
				if (this.userid == DataProl.account) {
					webNetworkMananger.getInstance().gameSceneRec.disPlayKillMan(killNumber);
				}
			}
			this.killNum = killNumber;
		}
		/**帧动画数组 */
		protected Clip_shuzu = new Array();
		/**添加帧动画到数组 */
		protected addClip() {
			for (var i = 0; i < 9; i++) {
				var data = RES.getRes(ClipName[i] + "_json");
				var txtr = RES.getRes(ClipName[i] + "_png");
				var MovieClipFactory = new egret.MovieClipDataFactory(data, txtr);
				var Clip = new egret.MovieClip(MovieClipFactory.generateMovieClipData(ClipName[i]));
				Clip.name = ClipName[i];
				Clip.anchorOffsetX = Clip.width / 2;
				Clip.anchorOffsetY = Clip.height / 2;
				Clip.scaleX = 0.5;
				Clip.scaleY = 0.5;
				this.Clip_shuzu.push(Clip);
			}

		}
		/**眩晕次数 */
		protected xuanyunTime = 0;
		/**变色次数 */
		protected bianseTime = 0;
		/**迷雾次数 */
		protected miwuTime = 0;
		/**心碎次数 */
		protected xinsuiTime = 0;
		/**播放帧动画 */
		protected MovieClipPlay(type: number) {
			//return;
			this.Clip_shuzu[type].visible = true;
			if (this.Clip_shuzu[type].name == "xuanyun") {
				//this.netrolelock();//眩晕时锁定摇杆
				//设置眩晕时旋转的星星在青蛙头顶
				this.Clip_shuzu[type].anchorOffsetX = this.shipin1.width / 2;
				this.Clip_shuzu[type].anchorOffsetY = this.shipin1.height / 2;
				this.Clip_shuzu[type].x = -3;
				this.Clip_shuzu[type].y = -50;
				this.addChild(this.Clip_shuzu[type]);
				if (this.xuanyunTime == 0) {
					this.xuanyunTime = 1;
					this.Clip_shuzu[type].play(1);
				} else {
					this.Clip_shuzu[type].play(2);
				}
				this.Clip_CallBack(type, 1000);
				return;
			}
			if (this.Clip_shuzu[type].name == "drink") {
				//this.netrolelock();//喝酒时锁定摇杆
				this.Clip_shuzu[type].scaleX = this.Clip_shuzu[type].scaleY = 0.8;
				this.Clip_shuzu[type].anchorOffsetX = this.shipin1.width / 2;
				this.Clip_shuzu[type].anchorOffsetY = this.shipin1.height / 2;
				this.Clip_shuzu[type].x = 10;
				this.Clip_shuzu[type].y = -100;
				this.addChild(this.Clip_shuzu[type]);
				//FrogEyesManage.GetInstance().ChangeEyes(this.frogAniamtionDis, 4, this.leftEye, this.rightEye);
				this.Clip_shuzu[type].play(serverConfig.config.propBuffReationTime.drink / 1000 + 5);
				this.Clip_CallBack(type, serverConfig.config.propBuffReationTime.drink);
				return;
			}
			if (this.Clip_shuzu[type].name == "paopao") {
				this.addChild(this.Clip_shuzu[type]);
				//设定眩晕时副帧动画（第二个帧动画）的冒泡的位置从青蛙头顶开始
				this.Clip_shuzu[type].x = -100;
				this.Clip_shuzu[type].y = -150;
				this.Clip_shuzu[type].play(serverConfig.config.propBuffReationTime.drink / 1000);
				return;
			}
			if (this.Clip_shuzu[type].name == "bianse") {
				this.Clip_shuzu[type].scaleX = this.Clip_shuzu[type].scaleY = 1;
				this.ClipLayer.addChild(this.Clip_shuzu[type]);
				if (this.bianseTime == 0) {
					this.setClip(type, -45, -160, 1);
					this.bianseTime = 1;
				} else {
					this.setClip(type, -45, -160, 2);
				}
				this.Clip_CallBack(type, 1000);
				return;
			}
			if (this.Clip_shuzu[type].name == "ice") {
				//this.netrolelock();//眩晕时锁定摇杆
				this.ClipLayer.addChild(this.Clip_shuzu[type]);
				this.Clip_shuzu[type].scaleX = this.Clip_shuzu[type].scaleY = 0.8;
				this.setClip(type, 10, -140, serverConfig.config.propBuffReationTime.ice / 1000);
				this.Clip_CallBack(type, serverConfig.config.propBuffReationTime.ice);
				this.ice_Play();
				return;
			}
			if (this.Clip_shuzu[type].name == "jiandao") {
				this.ClipLayer.addChild(this.Clip_shuzu[type]);
				this.setClip(type, 10, -125, serverConfig.config.propBuffReationTime.cut / 1000);
				this.Clip_CallBack(type, serverConfig.config.propBuffReationTime.cut);
				return;
			}
			if (this.Clip_shuzu[type].name == "heart") {
				this.ClipLayer.addChild(this.Clip_shuzu[type]);
				this.setClip(type, 0, -85, 2);
				return;
			}
			if (this.Clip_shuzu[type].name == "miwu") {
				this.Clip_shuzu[type].scaleX = this.Clip_shuzu[type].scaleY = 0.8;
				//this.ClipLayer.addChild(this.Clip_shuzu[type]);
				this.addChild(this.Clip_shuzu[type]);
				this.Clip_shuzu[type].x = -40;
				this.Clip_shuzu[type].y = -60;
				if (this.miwuTime == 0) {
					this.Clip_shuzu[type].play(1);
					this.miwuTime = 1;
				} else {
					this.Clip_shuzu[type].play(2);
				}
				this.Clip_CallBack(type, 1000);
				return;
			}
			if (this.Clip_shuzu[type].name == "xinsui") {
				//this.netrolelock();//心碎时锁定摇杆
				this.addChild(this.Clip_shuzu[type]);
				//设定眩晕时副帧动画（第二个帧动画）的冒泡的位置从青蛙头顶开始
				this.Clip_shuzu[type].x = -30;
				this.Clip_shuzu[type].y = -100;
				this.Clip_shuzu[type].scaleX = this.Clip_shuzu[type].scaleY = 0.8;
				if (this.xinsuiTime == 0) {
					this.xinsuiTime = 1;
					this.Clip_shuzu[type].play(1);
				} else {
					this.Clip_shuzu[type].play(2);
				}
				this.Clip_CallBack(type, 1000);
				this.eye_change1();
				this.eye_change2();
				egret.Tween.get(this.Clip_shuzu[type])
					.to({ alpha: 1 }, 1000 + 10)
					.call(() => {
						this.Clip_shuzu[type].visible = false;
						this.nowPropsType[8] = -1;
					}, this);
				return;
			}
		}
		/** 冰冻效果2：青蛙身上出现冰块*/
		protected ice_Play() {
			//this.ice2.texture = RES.getRes("ice_2_png");
			this.ice2.anchorOffsetX = this.ice2.width / 2;
			this.ice2.anchorOffsetY = this.ice2.height / 2;
			if (this.mainLevel == 1) {
				this.ice2.scaleX = this.ice2.scaleY = 0.8;
			} else if (this.mainLevel == 2) {
				this.ice2.scaleX = this.ice2.scaleY = 0.9;
			} else if (this.mainLevel == 3) {
				this.ice2.scaleX = this.ice2.scaleY = 1.1;
			} else {
				this.ice2.scaleX = this.ice2.scaleY = 1.2;
			}
			this.ice2.x = 0;
			this.ice2.y = -10;
			this.ice2.visible = true;
			this.addChild(this.ice2);
			this.ice2.alpha = 0;
			egret.Tween.get(this.ice2)
				.to({ alpha: 1 }, 1000)
				.to({ alpha: 1 }, serverConfig.config.propBuffReationTime.ice - 2000)
				.to({ alpha: 0 }, 1000)
			return;
		}
		/** 舔到异色青蛙眼睛两边变化*/
		protected eye_change1() {
			//FrogEyesManage.GetInstance().ChangeEyes(this.frogAniamtionDis, 5, this.leftEye, this.rightEye);
			// var heixian: eui.Image = new eui.Image();
			// heixian.texture = RES.getRes("heixian_png");
			// heixian.anchorOffsetX = heixian.width / 2;
			// heixian.anchorOffsetY = heixian.height / 2;
			// var han: eui.Image = new eui.Image();
			// han.texture = RES.getRes("han_png");
			// han.anchorOffsetX = han.width / 2;
			// han.anchorOffsetY = han.height / 2;
			this.han.visible = true;
			this.heixian.visible = true;
			if (this.mainLevel == 1) {
				this.heixian.x = 20;
				this.heixian.y = -45;
				this.han.x = -30;
				this.han.y = -40;
				this.heixian.scaleX = this.heixian.scaleY = 0.7;
				this.han.scaleX = this.han.scaleY = 0.2;
			} else if (this.mainLevel == 2) {
				this.heixian.x = 22;
				this.heixian.y = -45;
				this.han.x = -22;
				this.han.y = -40;
				this.heixian.scaleX = this.heixian.scaleY = 0.75;
				this.han.scaleX = this.han.scaleY = 0.25;
			} else if (this.mainLevel == 3) {
				this.heixian.x = 30;
				this.heixian.y = -45;
				this.han.x = -30;
				this.han.y = -40;
				this.heixian.scaleX = this.heixian.scaleY = 0.8;
				this.han.scaleX = this.han.scaleY = 0.3;
			} else {
				this.heixian.x = 40;
				this.heixian.y = -45;
				this.han.x = -30;
				this.han.y = -40;
				this.heixian.scaleX = this.heixian.scaleY = 0.85;
				this.han.scaleX = this.han.scaleY = 0.35;
			}
			this.han.x = -30;
			this.han.y = -40;
			this.addChild(this.heixian);
			this.addChild(this.han);
			this.han.alpha = 0;
			egret.Tween.get(this.heixian)
				.to({ alpha: 1 }, 50)
				.to({ y: this.heixian.y + 10 }, 950)
			egret.Tween.get(this.han)
				.to({ alpha: 1 }, 50)
				.to({ scaleX: this.han.scaleX + 0.8, scaleY: this.han.scaleY + 0.8 }, 100)
				.to({ scaleX: this.han.scaleX - 0.8, scaleY: this.han.scaleY - 0.8 }, 100)
				.to({ scaleX: this.han.scaleX + 0.8, scaleY: this.han.scaleY + 0.8 }, 100)
				.to({ scaleX: this.han.scaleX - 0.8, scaleY: this.han.scaleY - 0.8 }, 100)
				.to({ scaleX: this.han.scaleX + 0.8, scaleY: this.han.scaleY + 0.8 }, 100)
				.to({ scaleX: this.han.scaleX - 0.8, scaleY: this.han.scaleY - 0.8 }, 100)
				.to({ scaleX: this.han.scaleX + 0.8, scaleY: this.han.scaleY + 0.8 }, 100)
				.to({ scaleX: this.han.scaleX - 0.8, scaleY: this.han.scaleY - 0.8 }, 100)
				.to({ scaleX: this.han.scaleX + 0.8, scaleY: this.han.scaleY + 0.8 }, 100)
				.to({ alpha: 0 }, 60)
				.call(() => {
					this.han.visible = false;
					this.heixian.visible = false;
					//FrogEyesManage.GetInstance().ChangeEyes(this.frogAniamtionDis, 1, this.leftEye, this.rightEye);
				}, this);
			return;
		}
		/** 舔到异色青蛙眼睛内变化*/
		protected eye_change2() {
			// var eyeLeft: eui.Image = new eui.Image();
			// eyeLeft.texture = RES.getRes("eye_black_png");
			// eyeLeft.anchorOffsetX = eyeLeft.width / 2;
			// eyeLeft.anchorOffsetY = eyeLeft.height / 2;
			// var eyeRight: eui.Image = new eui.Image();
			// eyeRight.texture = RES.getRes("eye_black_png");
			// eyeRight.anchorOffsetX = eyeRight.width / 2;
			// eyeRight.anchorOffsetY = eyeRight.height / 2;
			if (this.mainLevel == 1) {
				this.eyeLeft.scaleX = this.eyeLeft.scaleY = 0.33;
				this.eyeRight.scaleX = this.eyeRight.scaleY = 0.33;
				this.eyeLeft.x = -14;
				this.eyeRight.x = 13;
			} else if (this.mainLevel == 2) {
				this.eyeLeft.scaleX = this.eyeLeft.scaleY = 0.35;
				this.eyeRight.scaleX = this.eyeRight.scaleY = 0.35;
				this.eyeLeft.x = -10;
				this.eyeRight.x = 17;
			} else if (this.mainLevel == 3) {
				this.eyeLeft.scaleX = this.eyeLeft.scaleY = 0.38;
				this.eyeRight.scaleX = this.eyeRight.scaleY = 0.38;
				this.eyeLeft.x = -14;
				this.eyeRight.x = 19;
			} else {
				this.eyeLeft.scaleX = this.eyeLeft.scaleY = 0.4;
				this.eyeRight.scaleX = this.eyeRight.scaleY = 0.4;
				this.eyeLeft.x = -14;
				this.eyeRight.x = 19;
			}
			this.eyeLeft.y = -33;
			this.eyeRight.y = -33;
			this.eyeLeft.visible = true;
			this.eyeRight.visible = true;
			this.addChild(this.eyeLeft);
			this.addChild(this.eyeRight);
			this.eye_Tween(this.eyeLeft);
			this.eye_Tween(this.eyeRight);
		}
		/**眼珠tween动画 */
		protected eye_Tween(eye) {
			egret.Tween.get(eye)
				.to({ scaleX: 0, scaleY: 0 }, 300)
				.call(() => {
					//eye.texture = RES.getRes("eye_22_png");
					eye.texture = this.eyeLR.texture;
					eye.anchorOffsetX = eye.width / 2;
					eye.anchorOffsetY = eye.height / 2;
					eye.scaleX = 0.2;
					eye.scaleY = 1;
					egret.Tween.get(eye)
						.to({ scaleX: 1 }, 200)
						.to({ scaleX: 0.2 }, 200)
						.to({ alpha: 1 }, 310)
						.call(() => {
							eye.visible = false;
						}, this);
				}, this);
		}
		/**帧动画回调的隐藏动画方法 */
		protected Clip_CallBack(type: number, time: number) {
			egret.Tween.get(this.Clip_shuzu[type])
				.to({ alpha: 1 }, time + 10)
				.call(() => {
					this.Clip_shuzu[type].visible = false;
					//this.nowPropsType[type + 1] = -1;
					if (this.userid == DataProl.account) {//判断是不是自己
						this.OnresetShadowFogPoint(this);
					}
				}, this);
		}
		public setClip(type: number, x: any, y: any, num: number) {
			this.Clip_shuzu[type].play(num);//帧动画播放次数
			///**固定动画播放位置在名字正上方，且方向固定 */
			var nameTimer: egret.Timer = new egret.Timer(10, -1);
			nameTimer.addEventListener(egret.TimerEvent.TIMER, e => {
				this.Clip_shuzu[type].x = this.x + x;
				this.Clip_shuzu[type].y = this.y + y;
			}, this);
			nameTimer.start();
		}
		/**显示道具效果 */
		protected displayEffectOfProps(propstates) {
			//for (var i = 0; i < propstates.length; i++) {
			var type = propstates.getPropType;
			if (type == 0) {
				this.nowPropsType = [0, 0, 0, 0, 0, 0, 0, 0, 0];
				this.ClipLayer.removeChildren();
				//解锁摇杆
				if (this.userid == DataProl.account) {
					this.netunrolelock();
				}
				return;
				//continue;
			}
			if (this.nowPropsType[type - 1] == type) {
				//continue;
				return;
			}
			if (type == 1) {
				this.effectOfProps = this.zhuangtai_1;
				this.effectOfProps.anchorOffsetX = this.effectOfProps.width / 2;
				this.effectOfProps.anchorOffsetY = this.effectOfProps.height / 2;
				this.effectOfProps.scaleX = this.effectOfProps.scaleY = 0.5;
				this.effectOfProps.visible = true;
				this.alpha = 0.1;
				this.nowPropsType[type - 1] = type;
				return;
				//console.log("111111111              " + this.nowPropsType);
				//continue;
			}
			if (type == 6 || type == 7) {
				//continue;
				return;
			}
			if (type == 8) {
				this.nowPropsType[type - 1] = type
				this.ClipLayer.removeChildren();
				//锁定摇杆
				if (this.userid == DataProl.account) {
					this.netrolelock();
				}
				this.MovieClipPlay(type - 2);//帧动画播放方法
				this.bowen();
				return;
			}
			if (type == 9) {
				this.nowPropsType[type - 1] = type
				this.ClipLayer.removeChildren();
				this.MovieClipPlay(type - 1);//帧动画播放方法
				return;
			}
			if (type == 3 || type == 2 || type == 5) {
				this.ClipLayer.removeChildren();
				if (type == 2) {
					//锁定摇杆
					if (this.userid == DataProl.account) {
						this.netrolelock();
					}
				}
				this.MovieClipPlay(type - 2);//帧动画播放方法
				if (type == 5) {//吃到变色道具
					this.MovieClipPlay(7);//播放变色迷雾
				}
				this.nowPropsType[type - 1] = type
				return;
				//console.log("222222222222          " + this.nowPropsType);
				//continue;
			}
			if (type == 4) {
				this.ClipLayer.removeChildren();
				//锁定摇杆
				if (this.userid == DataProl.account) {
					this.netrolelock();
				}
				this.MovieClipPlay(type - 2);//帧动画播放方法
				this.MovieClipPlay(5);
				this.nowPropsType[type - 1] = type
				return;
				//continue;
			}
			//}
		}
		/**震颤次数 */
		protected zhenchanTimeRight = 0;
		protected zhenchanTimeLeft = 0;
		/**添加碰撞是左右两侧的波纹(bowen) */
		protected bowen() {

			this.bwRight.x = 50;
			this.bwRight.y = 0;
			this.bwRight.visible = true;
			this.addChild(this.bwRight);

			this.bwLeft.skewY = 180;
			this.bwLeft.x = -50;
			this.bwLeft.y = 0;
			this.bwLeft.visible = true;
			this.addChild(this.bwLeft);
			this.zhenchan(this.bwRight, this.zhenchanTimeRight, 60, 50)
			this.zhenchan(this.bwLeft, this.zhenchanTimeLeft, -60, -50)
		}

		protected zhenchan(picture, time, x1: number, x2: number) {
			egret.Tween.get(picture)
				.to({ x: x1 }, 50)
				.to({ x: x2 }, 50)
				.to({ alpha: 1 }, 5)
				.call(e => {
					if (time < serverConfig.config.propBuffReationTime.dizzy / 100 - 1) {
						time += 1;
						this.zhenchan(picture, time, x1, x2)
					} else {
						time = 0;
						picture.visible = false;
					}
				});
		}
		/**饰品设置 */
		protected shipinInit() {
			this.shipin.texture = RES.getRes("shipin_1");
			this.shipin.anchorOffsetX = this.shipin.width / 2;
			this.shipin.anchorOffsetY = this.shipin.height / 2;
			this.shipin.x = 0;
			this.shipin.y = -35;
			this.shipin.scaleX = 0.7;
			this.shipin.scaleY = 0.85;
			this.addChild(this.shipin);
			this.shipin.visible = false;
			//this.changeShipin("shipin_" + (Math.floor(Math.random()*5+1)));
		}
		/**击杀表情 */
		protected jisha() {
			this.shipin1.texture = RES.getRes("mojing");
			this.shipin1.anchorOffsetX = this.shipin1.width / 2;
			this.shipin1.anchorOffsetY = this.shipin1.height / 2;
			this.shipin1.x = 0;
			this.shipin1.y = -35;
			this.shipin1.scaleX = 0.7;
			this.shipin1.scaleY = 0.85;
			this.addChild(this.shipin1);
			this.shipin1.visible = false;
			//this.changeShipin("shipin_" + (Math.floor(Math.random()*5+1)));
		}
		/**改变饰品 */
		protected changeShipin(shipintype) {
			switch (shipintype) {
				case "shipin_1":
					this.shipin.texture = this.shipin_1.texture;
					break;
				case "shipin_2":
					this.shipin.texture = this.shipin_2.texture;
					break;
				case "shipin_3":
					this.shipin.texture = this.shipin_3.texture;
					break;
				case "shipin_4":
					this.shipin.texture = this.shipin_4.texture;
					break;
				case "shipin_5":
					this.shipin.texture = this.shipin_5.texture;
					break;
			}
			//this.shipin.texture = RES.getRes(shipintype);
			this.shipin.visible = true;
		}

		/**显示护盾 */
		protected displayShield() {
			this.shieldOuter.texture = RES.getRes("hudun_wai");
			this.shieldInside.texture = RES.getRes("hudun_nei");

			this.shieldOuter.anchorOffsetX = this.shieldOuter.width / 2;
			this.shieldOuter.anchorOffsetY = this.shieldOuter.height / 2;

			this.shieldInside.anchorOffsetX = this.shieldInside.width / 2;
			this.shieldInside.anchorOffsetY = this.shieldInside.height / 2;

			this.shieldOuter.x = this.shieldInside.x = 0;
			this.shieldOuter.y = this.shieldInside.y = -25;
			this.addChild(this.shieldOuter);
			this.addChild(this.shieldInside);
			this.displayOrHideShield(false);

			this.tu.anchorOffsetX = this.tu.width / 2;
			this.tu.anchorOffsetY = this.tu.height / 2;
			this.tu.x = 0;
			this.tu.y = -35;
			this.addChild(this.tu);
			this.tu.visible = false;
		}
		/**显示或隐藏保护罩 */
		protected displayOrHideShield(disOrHide: boolean) {
			this.shieldOuter.visible = this.shieldInside.visible = disOrHide;
			if (disOrHide) {
				egret.Tween.get(this.shieldInside).to({ rotation: (this.shieldInside.rotation + 4) }, 1000 / 60);
				this.killNum = 0;
			}
			else {
				egret.Tween.removeTweens(this.shieldInside);
			}

		}
		/**伸舌 */
		// public loll() {
		// 	if (!this.tweenOver) {
		// 		return;
		// 	}
		// 	egret.Tween.removeTweens(this);
		// 	let tonguePoint = this.localToGlobal(this.tongue.x, this.tongue.y);
		// 	let myPoint = this.parent.localToGlobal(this.x, this.y);
		// 	let direction = tonguePoint.subtract(myPoint);
		// 	//给服务器发送射击信息
		// 	AIServer.getInstance().shoot(this.userid, direction);
		// }
		/**伸舌动画 */
		public lollAnime(longTongue: number) {
			let length = longTongue == 0 ? this.frogLineLength : longTongue;
			let tongue: eui.Image = this.tongue;
			tongue.height = this.scaleX * this.tongueWide;
			tongue.y = this.scaleX * (0 - 40);
			tongue.visible = true;
			tongue.width = 0;
			egret.Tween.get(tongue).to({ width: length * frogConfig.independent_Long_tongue_coefficient }, 100).to({ width: 0 }, 100).call(e => { tongue.visible = false });
		}
		/**伸舌 */
		public loll() {
			egret.Tween.removeTweens(this);
			let tongue: eui.Image = new eui.Image;
			tongue.texture = RES.getRes("shetou");
			tongue.anchorOffsetY = tongue.height / 2;
			tongue.height = this.scaleX * tongue.height;
			tongue.width = this.scaleX * this.tongueWide;
			tongue.y = this.scaleX * (0 - 50);
			tongue.rotation = (0 - 90);
			this.addChild(tongue);
			egret.Tween.get(tongue).to({ width: this.frogLineLength }, 100).to({ width: 0 }, 100).call(e => { this.removeChild(tongue); });

			if (this.userid == DataProl.account) {
				let tonguePoint = this.localToGlobal(tongue.x, tongue.y);
				let myPoint = this.parent.localToGlobal(this.x, this.y);
				let direction = tonguePoint.subtract(myPoint);
				let m_AwesomeMessage = new awesomepackage.AwesomeMessage();
				let m_c2sShoot = new awesomepackage.c2sShoot();
				m_c2sShoot.account = DataProl.account;
				m_c2sShoot.roomId = DataProl.roomid;
				m_c2sShoot.dirX = Math.floor(direction.x * 10);
				m_c2sShoot.dirY = Math.floor(direction.y * 10);
				m_AwesomeMessage.meesageId = 1030;
				m_AwesomeMessage.data = awesomepackage.c2sShoot.encode(m_c2sShoot).finish();
				var buffer = awesomepackage.AwesomeMessage.encode(m_AwesomeMessage).finish();
				var byte2: egret.ByteArray = new egret.ByteArray(buffer);
				webNetworkMananger.getInstance().SendBitMeesage(byte2);
			}
		}
		/**获取朝向坐标 */
		public getTowardCoordinates() {
			let front = this.localToGlobal(0, this.size);
			let myPoint = this.parent.localToGlobal(this.x, this.y);
			let direction = front.subtract(myPoint);
			return direction;
		}


		/**反向弹出 */
		public ReversePop_up(point: egret.Point, isaccount = false) {
			let myOrientation: egret.Point = this.getTowardCoordinates();
			//this.netrolelock();
			if (myOrientation != null && myOrientation != undefined) {
				myOrientation.setTo(myOrientation.x, myOrientation.y);
				myOrientation.normalize(100);
				let targePoint = myOrientation.add(new egret.Point(this.x, this.y));
				// egret.Tween.get(this).to({ x: targePoint.x, y: targePoint.y }, 200).call(e => {
				// 	//this.canMove = true 
				// });
				if (isaccount) {
					var myAnimation = TweenLite.to(this, 0.5, { x: targePoint.x, y: targePoint.y, ease: Back.easeInOut });
					myAnimation.eventCallback("onComplete", this.OnresetShadowFogPoint, [this]);
				}

				else
					TweenLite.to(this, 0.5, { x: targePoint.x, y: targePoint.y, ease: Back.easeInOut });
				//	this.netunrolelock()
			}
		}

		//console.log("X,Y" + obj.x + "," + obj.y);

		/**重置影子青蛙的位置 */
		public OnresetShadowFogPoint(obj) {

			let shadowFrog = obj.m_frogMgr.findFrogById(DataProl.shadowFrogId);
			if (shadowFrog != null) {
				shadowFrog.x = obj.x;
				shadowFrog.y = obj.y;
				console.log("同步更改影子青蛙" + DataProl.shadowFrogId);
			}

		}
		/**青蛙动画初始化 */
		protected frogAnimationInit() {
			this.removeChild(this.frogAniamtionDis);
			this.frogAniamtionDis.armature.dispose();
			this.frogAniamtionDis = null;
		}
		/**通过分数获取属性 */
		public GetAttributesByGrade(grade) {
			/**舌宽 */
			let tongueWideData: number = 0;
			/**线长 */
			let lineLength: number = 0;
			/**大级 */
			let largeMagnitude: number = 0;
			/**小级 */
			let smallMagnitude: number = 0;
			if (parseInt(grade) >= 15000) {
				tongueWideData = 15;
				lineLength = 600;
				largeMagnitude = 4;
			} else if (parseInt(grade) >= 9000) {
				tongueWideData = 13;
				lineLength = 500;
				largeMagnitude = 3;
				smallMagnitude = 6;
			} else if (parseInt(grade) >= 7800) {
				tongueWideData = 13;
				lineLength = 460;
				largeMagnitude = 3;
				smallMagnitude = 5;
			} else if (parseInt(grade) >= 6600) {
				tongueWideData = 12;
				lineLength = 420;
				largeMagnitude = 3;
				smallMagnitude = 4;
			} else if (parseInt(grade) >= 5600) {
				tongueWideData = 12;
				lineLength = 380;
				largeMagnitude = 3;
				smallMagnitude = 3;
			} else if (parseInt(grade) >= 4800) {
				tongueWideData = 11;
				lineLength = 350;
				largeMagnitude = 3;
				smallMagnitude = 2;
			} else if (parseInt(grade) >= 4000) {
				tongueWideData = 11;
				lineLength = 320;
				largeMagnitude = 3;
				smallMagnitude = 1;
			} else if (parseInt(grade) >= 3200) {
				tongueWideData = 10;
				lineLength = 280;
				largeMagnitude = 2;
				smallMagnitude = 6;
			} else if (parseInt(grade) >= 2600) {
				tongueWideData = 10;
				lineLength = 260;
				largeMagnitude = 2;
				smallMagnitude = 5;
			} else if (parseInt(grade) >= 2100) {
				tongueWideData = 9;
				lineLength = 240;
				largeMagnitude = 2;
				smallMagnitude = 4;
			} else if (parseInt(grade) >= 1700) {
				tongueWideData = 9;
				lineLength = 220;
				largeMagnitude = 2;
				smallMagnitude = 3;
			} else if (parseInt(grade) >= 1300) {
				tongueWideData = 8;
				lineLength = 200;
				largeMagnitude = 2;
				smallMagnitude = 2;
			} else if (parseInt(grade) >= 1000) {
				tongueWideData = 8;
				lineLength = 180;
				largeMagnitude = 2;
				smallMagnitude = 1;
			} else if (parseInt(grade) >= 700) {
				tongueWideData = 7;
				lineLength = 150;
				largeMagnitude = 1;
				smallMagnitude = 6;
			} else if (parseInt(grade) >= 550) {
				tongueWideData = 7;
				lineLength = 140;
				largeMagnitude = 1;
				smallMagnitude = 5;
			} else if (parseInt(grade) >= 400) {
				tongueWideData = 6;
				lineLength = 130;
				largeMagnitude = 1;
				smallMagnitude = 4;
			} else if (parseInt(grade) >= 250) {
				tongueWideData = 6;
				lineLength = 120;
				largeMagnitude = 1;
				smallMagnitude = 3;
			} else if (parseInt(grade) >= 100) {
				tongueWideData = 5;
				lineLength = 110;
				largeMagnitude = 1;
				smallMagnitude = 2;
			} else {
				tongueWideData = 5;
				lineLength = 100;
				largeMagnitude = 1;
				smallMagnitude = 1;
			}
			this.bianda(lineLength);
			return {
				tongueWide: tongueWideData,
				frogLineLength: lineLength,
				mainType: largeMagnitude,
				minorType: smallMagnitude
			}
		}
		/**处理青蛙升级
		 * @param playerData 玩家数据
		 */
		public dealFrogUpgrade(playerData) {
			//升级数据不对，暂时关闭升级
			return;
			if (this.level == playerData.level) {
				return;
			}
			//升级播放升级特效
			if (this.level < playerData.level) {
				this.playUserUpgrade(this._texture, this._config, 0, 0);
			}
			//如果主要等级不同换龙骨
			if (Math.floor(this.level / 10) != Math.floor(playerData.level / 10)) {
				this.level = playerData.level;
				/**主要等级 */
				let mainLevel = Math.floor(this.level / 10);
				this.frogAnimationInit();
				this.frogAniamtionDis = meterAanimation.getInstance().GetDragonAnimation(mainLevel);
				this.addChild(this.frogAniamtionDis);
				this.setChildIndex(this.frogAniamtionDis, 0);
				//升级体积变化
				switch (mainLevel) {
					case 1:
						this.scaleX = this.scaleY = 1;
						break;
					case 2:
						this.scaleX = this.scaleY = 1.3;
						break;
					case 3:
						this.scaleX = this.scaleY = 1.7;
						break;
					case 4:
						this.scaleX = this.scaleY = 2.2;
						break;
					default:
						break;
				}
			}
			this.level = playerData.level;
			FrogReloadingSystem.GetInstance().Reloading(this.frogAniamtionDis, this.type, this.level);
		}
		/**连线青蛙后置 */
		public setFrogPos() {
			this.frogAniamtionDis.y = this.frogIsHadLine ? 0 : 0;
			this.shieldOuter.y = this.shieldInside.y = this.frogAniamtionDis.y - 25;
		}
		/**设置下个目标点 */
		public setTargetPoint(point) {
			if (this.userid == DataProl.shadowFrogId) {
				this.targetPoint.x = this.x + point.x;
				this.targetPoint.y = this.y + point.y;
				return;
			}
			//	console.log("服务器发送坐标:x:" + point.x + "y:" + point.y);
			this.targetPoint.x = Math.floor(point.x);
			this.targetPoint.y = Math.floor(point.y);
			if (this.canMove) {
				this.frogMoveto();
			}
		}
		public changeType() {
			FrogReloadingSystem.GetInstance().Reloading(this.frogAniamtionDis, this.type, this.level);
		}
		protected time: number;
		public update() {

		}
		/**青蛙转向 */
		public frogVeer() {
			if (!this.canMove) {
				return;
			}
			egret.Tween.removeTweens(this);
			var angle = this.getFrogAngle(this.x, this.y, this.targetPoint.x, this.targetPoint.y);
			if (this.userid == DataProl.shadowFrogId && this.gamePanleHandle.yaogan) {
				angle = this.gamePanleHandle.yaogan.getRotation();
			}
			if (!this.frogIsHadLine) {
				if (this.x == this.targetPoint.x && this.y == this.targetPoint.y) {
					return;
				}
			}
			if (!isNaN(angle)) {
				var addtime = 0;
				if (angle > 160) {
					addtime += angle / 90;
				}
				egret.Tween.get(this).to({ rotation: angle }, gameGlobal.global.frogRotateTime - addtime);
			}
		}

		/*判断*/
		public shadowFrogMoveto(target) {
			egret.Tween.removeTweens(this);
			this.curPoint.x = this.x;
			this.curPoint.y = this.y;
			// if (!this.frogIsHadLine) {
			// 	if (this.x == this.targetPoint.x && this.y == this.targetPoint.y) {
			// 		//console.log("玩家没有移动");
			// 		return;
			// 	}
			// }
			/**影子青蛙移动 */

			this.x = this.x + target.x;
			this.y = this.y + target.y;

			if (this.x > gameGlobal.global.gameWidth - 55) {
				console.log("bianjie1");
				this.x = gameGlobal.global.gameWidth - 55;
			}
			if (this.y > gameGlobal.global.gameHeight - 65) {
				this.y = gameGlobal.global.gameHeight - 65;
				console.log("bianjie2");
			}
			if (this.x < 50) {
				this.x = 50;
				console.log("bianjie3");
			}
			if (this.y < 60) {
				this.y = 60;
				console.log("bianjie4");
			}
			return;
		}
		/**青蛙移动 */
		public frogMoveto() {
			//var angle = this.getFrogAngle(this.x, this.y, this.targetPoint.x, this.targetPoint.y);
			//TweenLite.killTweensOf(this);
			egret.Tween.removeTweens(this);
			this.curPoint.x = this.x;
			this.curPoint.y = this.y;
			if (!this.frogIsHadLine) {
				if (this.x == this.targetPoint.x && this.y == this.targetPoint.y) {
					//console.log("玩家没有移动");
					return;
				}
			}
			/**影子青蛙移动 */
			if (this.userid == DataProl.shadowFrogId) {
				this.x = this.targetPoint.x;
				this.y = this.targetPoint.y;
				return;
			}
			// if (!isNaN(angle)) {
			// 	var addtime = 0;
			// 	if (angle > 160) {
			// 		addtime += angle / 90;
			// 	}
			// 	egret.Tween.get(this).to({ rotation: angle }, gameGlobal.global.frogRotateTime - addtime);
			// }
			//console.log("angle" + angle);
			var dis = egret.Point.distance(this.targetPoint, this.curPoint);
			if (dis > this.speed) {
				//console.log("angle" + dis);

			}

			//console.log("targetPoint" + this.targetPoint.x);
			//console.log("mypoint" + this.x);
			// var myArray = [1,2,3,4];
			// TweenLite.to(myArray, 0.1, { endArray: [10,20,30,40] });
			//如果目标点没有变，则直接移动
			if (this.targetPoint.equals(this.lastTargetPoint)) {
				return;
			}
			else {
				// let nextDir = new egret.Point();
				// nextDir = egret.Point.interpolate(this.targetPoint, this.curPoint, this.interpolation_plan / 6);
				// this.interpolation_plan++;
				// if (this.interpolation_plan >= 6) {
				// 	this.interpolation_plan = 1;
				// }
				// this.ismoving = true;
				var diftime = this.timeStamp + 100 - Date.now();
				//console.log("time" + diftime);
				// if (diftime < 0) {
				// 	diftime = 1;
				// }
				this.lastTargetPoint.x = this.targetPoint.x;
				this.lastTargetPoint.y = this.targetPoint.y;
				//egret.Tween.get(this).to({ x: this.targetPoint.x, y: this.targetPoint.y }, 1000).call(this.tweenComplete);;
				var myAnimation = TweenLite.to(this, 1 / 9, { x: this.targetPoint.x, y: this.targetPoint.y, ease: Linear.easeNone, onComplete: this.onFinishTween });
				myAnimation.eventCallback("onUpdate", this.OnTweenliteUpdate, [this]);
				myAnimation.eventCallback("onComplete", this.onFinishTween, [this]);
			}
		}
		protected onFinishTween(obj) {
			//console.log("end X,Y" + obj.x + "," + obj.y);
		}
		protected OnTweenliteUpdate(obj) {
			//console.log("X,Y" + obj.x + "," + obj.y);
		}
		protected tweenComplete() {
			//console.log("玩家移动完毕");
			this.ismoving = false;
		}
		/**获取玩家需要旋转的角度 */
		protected getFrogAngle(mx, my, targetx, targety): number {
			var angle;
			var ligUserId = null;
			var point = null;
			/*	if (!webNetworkMananger.isServerMove) 
				{
					console.log("个舌头");
				}
				else
				{
					console.log("11111111");
				}*/
			if (this.frogIsHadLine) {
				//if (!webNetworkMananger.isServerMove) {
				ligUserId = this.getLineUserId();

				if (ligUserId != null)
					point = this.getLineUserPoint(ligUserId);
				else
					angle = Util.getInstance().getRotation({ x: mx, y: my }, { x: targetx, y: targety });

				if (point != null)
					angle = Util.getInstance().getRotation({ x: mx, y: my }, { x: point.x, y: point.y });
				else
					angle = Util.getInstance().getRotation({ x: mx, y: my }, { x: targetx, y: targety });
			}
			else {
				if (this.userid == DataProl.account) {
					if (webNetworkMananger.getInstance().gameSceneRec.yaogan) {
						angle = webNetworkMananger.getInstance().gameSceneRec.yaogan.getRotation();
					}
				} else {
					angle = Util.getInstance().getRotation({ x: this.x, y: this.y }, { x: targetx, y: targety });
				}
			}
			return angle;
		}
		/**
		 * 获取连线玩家Id
		 */
		protected getLineUserId() {
			return this.m_frogMgr.getLigatureUserId(this.userid);
		}
		/**
		 * 获取连线玩家坐标
		 */
		protected getLineUserPoint(ligaUserId): any {
			var frog = this.m_frogMgr.findFrogById(ligaUserId);
			if (frog == null) {
				return null;
			}
			return { x: frog.x, y: frog.y };
		}
		/***
		 * reset frog states when it's not use
		 */
		/**青蛙重置 */
		public reset() {
			this.visible = false;
			this.isUsed = false;
			this.userid = -1;
			if (this.frogTrai)
				this.frogTrai.visible = false;
			this.x = 0;
			this.y = 0;
			this.scaleX = this.scaleY = 1;
			this.targetPoint.x = 0;
			this.targetPoint.y = 0;
			this.displayOrHideShield(false);
			this.frogName.text = "";
			this.frogName.visible = false;
			this.qineyer = 1;
			this.ClipLayer.removeChildren();//清除所有在ClipLayer层上的动画
			this.nowPropsType = [-1, -1, -1, -1, -1, -1, -1, -1, -1];
		}
		public sizeFrog(lenth: number): number {
			var size = 1;
			if (lenth > 150) {
				lenth -= 149;
				size = 1 + (lenth / this.size1);
				if (size >= 2.8) { size = 2.8 }
			} else {

			}

			return size;
		}
		public bianda(lenth: number) {//青蛙变大动画
			if (lenth > 150) {
				lenth -= 149;
				var a = 1 + (lenth / this.size1);
				if (a >= 3) { a = 3 }
				if (this.scaleX < 3) {
					egret.Tween.get(this).to({ scaleX: a + 0.3, scaleY: a + 0.3 }, 300).to({ scaleX: a - 0.15, scaleY: a - 0.15 }, 250).to({ scaleX: a + 0.15, scaleY: a + 0.15 }, 180).to({ scaleX: a - 0.1, scaleY: a - 0.1 }, 130).to({ scaleX: a, scaleY: a }, 100)
				}
				//虚影
				// meterAanimation.getInstance().playAnimation(0, 0,"lv" + this.level.toString(), "armatureName", "slow");
				// var froglogu = meterAanimation.getInstance().getArmart();
				// this.addChild(froglogu);
				// this.setChildIndex(froglogu, 1)
				// froglogu.x = this.frogAniamtionDis.x;
				// froglogu.y = this.frogAniamtionDis.y;
				// this.changeClothes.changeClothes(froglogu, this.type, this.level);
				// egret.Tween.get(this).to({scaleX:1+(lenth/1000),scaleY:1+(lenth/1000)},500)
				//  froglogu.scaleX=froglogu.scaleY=0.35
				//  egret.Tween.get(froglogu).to({alpha:0},500).call(()=>{
				// 	this.removeChild(froglogu);
				//  })
			} else {
				lenth -= 149;
				this.scaleX = this.scaleY = 1 + (lenth / 1000)
			}

		}
		//快要断线了
		public changeFaceEye(faceTppe: number, linemax: number) {//00修改快断线+舌头的最长距离a==0
			if (this.qineyer != faceTppe && this.qineyer != 4 && this.qineyer != 3) {
				this.qineyer = faceTppe;
				if (faceTppe == 1 || faceTppe == 0) {
					if (this.eyetime == -1) {
						//FrogEyesManage.GetInstance().ChangeEyes(this.frogAniamtionDis, faceTppe, this.leftEye, this.rightEye);
					}
				}
				else {
					this.eyetime = Date.now();
					//FrogEyesManage.GetInstance().ChangeEyes(this.frogAniamtionDis, faceTppe, this.leftEye, this.rightEye);
					if (faceTppe == 2) {//眼睛变红心帧动画
						this.MovieClipPlay(4);
						//this.MovieClipPlay(8);//测试帧动画
					}
				}
			}
		}
		public born(userid, name, x, y, frogType, levle, dressup) {
			if (userid == DataProl.shadowFrogId) {
				this.alpha = 0.5;
			}

			this.x = x;
			this.y = y;
			this.frogAnimationInit();
			this.frogAniamtionDis = meterAanimation.getInstance().GetDragonAnimation(1);
			this.addChild(this.frogAniamtionDis);
			this.setChildIndex(this.frogAniamtionDis, 0);
			this.userid = userid;
			this.username = name;
			this.type = 0;
			this.mainLevel = 1;
			this.minLevel = 1;
			this.ClipLayer.removeChildren();//清除所有在ClipLayer层上的动画
			this.nowPropsType = [-1, -1, -1, -1, -1, -1, -1, -1, -1];
			this.displayEffectOfProps(this.nowPropsType)
			/**初始化时换装  防止颜色出错*/
			FrogReloadingSystem.GetInstance().Reloading(this.frogAniamtionDis, this.type, this.level);
			if (dressup != null) {
				if (dressup.decorateId > 0) {
					this.changeShipin("shipin_" + (dressup.decorateId - 1000));
				}
				if (dressup.trailingId > 0) {
					this.frogTrailing(dressup.trailingId - 2000);
				}

			}

			// console.log("zhaungban   " + dressup.decorateId);
			// this.changeShipin("shipin_"+3);
			// this.frogTrailing(2);
			//this.setFrogName(this.userid.toString());
			this.setFrogName(this.username.toString());

			this.visible = true;
			this.isUsed = true;
			if (this.frogTrai)
				this.frogTrai.visible = true;
			if (userid == DataProl.account && webNetworkMananger.getInstance().gameSceneRec) {
				webNetworkMananger.getInstance().gameSceneRec.myUser.userSprit = this;
				webNetworkMananger.getInstance().gameSceneRec.camera.setTarget(this);
			}
			if (this.userid == DataProl.account) {//判断是不是自己
				this.OnresetShadowFogPoint(this);
			}
		}
		/**青蛙显示 */
		public frogShow() {
			this.visible = true;
		}
		/**设置青蛙的名字 */
		public setFrogName(nameStr) {
			if (nameStr == null || this.frogName == null)
				return;
			this.frogName.visible = true;
			var DisLen = gameGlobal.global.frogShowNameLength;

			var name = nameStr.length > DisLen ? nameStr.substring(0, DisLen) : nameStr;
			this.frogName.text = name;
			this.frogName.width = 220;
			if (this.userid == DataProl.account)
				this.frogName.textColor = 0xe3fe03;
		}

		public getdistance(x, y) {
			return Math.sqrt(x * x + y * y);
		}

		/**初始化名字 */
		protected displayFrogName() {
			this.frogName = new eui.Label();
			this.frogName.fontFamily = "Microsoft YaHei";
			this.frogName.width = 60;
			this.frogName.height = 40;
			this.frogName.anchorOffsetX = this.frogName.width / 2;
			this.frogName.anchorOffsetY = this.frogName.height / 2;

			this.effectOfProps.anchorOffsetX = this.effectOfProps.width / 2;
			this.effectOfProps.anchorOffsetY = this.effectOfProps.height / 2;
			this.effectOfProps.scaleX = this.effectOfProps.scaleY = 3;
			this.frogName.textAlign = egret.HorizontalAlign.CENTER;
			this.frogName.verticalAlign = egret.VerticalAlign.MIDDLE;

			this.gamePanleHandle.addChild(this.frogName);
			this.gamePanleHandle.addChild(this.effectOfProps);

			this.frogName.visible = true;
			var nameTimer: egret.Timer = new egret.Timer(10, -1);
			nameTimer.addEventListener(egret.TimerEvent.TIMER, e => {
				this.frogName.x = this.x - 70;
				this.frogName.y = this.y - 90;
				this.effectOfProps.x = this.x + 10;
				this.effectOfProps.y = this.y - 120;
			}, this);
			nameTimer.start();
		}

		/**播放玩家死亡动画 */
		public frogDied() {
			if (this.isUsed == false)
				return;
			//this.frogAniamtionDis.armature.animation.play("death");
			FrogReloadingSystem.GetInstance().Reloading(this.frogAniamtionDis, this.type, this.level);
			// this.frogAniamtionDis.addEventListener(dragonBones.EventObject.LOOP_COMPLETE, () => {
			// 	// if (this.userid == DataProl.account) {
			// 	// 	webNetworkMananger.getInstance().gameSceneRec.userDied.disPlayerDiedPanl();
			// 	// }
			// 	// this.reset();
			// }, this);
			if (this.userid == DataProl.account) {
				webNetworkMananger.getInstance().gameSceneRec.userDied.disPlayerDiedPanl();
			}
			this.reset();

		}

		//升级
		protected _texture: egret.Texture;
		protected _config: any;



		/**
		 * 播放玩家升级特效
		 */
		// protected playUserUpgrade(): void {
		// 	if (!serverConfig.config.isParticleRun)
		// 		return;
		// 	if (this._texture && this._config) {
		// 		var lizi = new particle.GravityParticleSystem(this._texture, this._config);
		// 		this.addChild(lizi);
		// 		lizi.start(1);
		// 		lizi.anchorOffsetX = lizi.width / 2;
		// 		lizi.anchorOffsetY = lizi.height / 2;
		// 		lizi.x = this.frogAniamtionDis.x;
		// 		lizi.y = this.frogAniamtionDis.y;
		// 	}
		// }
		protected playUserUpgrade(_texture: egret.Texture, _config: any, x: number, y: number): void {
			if (!serverConfig.config.isParticleRun)
				return;
			if (_texture && _config) {
				var lizi = new particle.GravityParticleSystem(_texture, _config);
				this.addChild(lizi);
				//this.tralingLayer.addChild(lizi);
				lizi.start(2);
				lizi.anchorOffsetX = lizi.width / 2;
				lizi.anchorOffsetY = lizi.height / 2;
				lizi.x = this.frogAniamtionDis.x + x;
				lizi.y = this.frogAniamtionDis.y + y;
			}
		}

		/**加载升级资源 */
		public loadRes(): void {
			this._texture = RES.getRes("LevelUp_png");
			this._config = RES.getRes("LevelUp_json");
		}

		/** 青蛙拖尾 */
		protected frogTrailing(type) {
			if (!serverConfig.config.isParticleRun)
				return;
			var tuowei_Texture = RES.getRes("tuowei_" + type.toString());
			var tuowei_Config = RES.getRes("newTuowei_json");
			if (tuowei_Texture && tuowei_Config) {
				this.frogTrai = new particle.GravityParticleSystem(tuowei_Texture, tuowei_Config);

				this.tralingLayer.addChild(this.frogTrai);

				this.frogTrai.start();

				var liziTimer: egret.Timer = new egret.Timer(100, -1);
				liziTimer.addEventListener(egret.TimerEvent.TIMER, e => {
					this.frogTrai.emitterX = this.x;
					this.frogTrai.emitterY = this.y;
				}, this);
				liziTimer.start();
			}
			if (!this.isUsed && this.frogTrai) {
				this.frogTrai.visible = false;
			}
		}
		/**弹开tween动画 */
		public flicktween(point) {
			this.canMove = false;
			//锁定摇杆
			this.netrolelock();
			var sX = this.scaleX;
			var sY = this.scaleY;
			//this.x=point.x;
			//this.y=point.y;
			egret.Tween.get(this).to({ scaleX: this.scaleX + 0.3, scaleY: this.scaleY + 0.3 }, 300).to({ scaleX: sX, scaleY: sY }, 300)
			egret.Tween.get(this).to({ x: point.x, y: point.y }, 600).call(this.flickcallback, this)

		}
		public flickcallback(e: egret.TouchEvent) {
			//删除所有tween动画
			egret.Tween.removeTweens(this);
			//重置影子青蛙
			if (this.userid == DataProl.account) {
				this.OnresetShadowFogPoint(this);
			}
			//解锁摇杆
			this.netunrolelock()
			this.canMove = true;
		}
		/**获取贝塞尔曲线终点*/
		public setPoint(pointoverX, pointoverY) {
			this.pointOver.x = pointoverX;
			this.pointOver.y = pointoverY;
		}
		/**获取贝塞尔曲线控制点 */
		public get factor(): number {
			return 0;
		}
		/**定位贝塞尔曲线控制点 */
		public set factor(value: number) {
			this.x = (1 - value) * (1 - value) * this.x + 2 * value * (1 - value) * (this.x + this.pointOver.x) / 2 + value * value * (this.pointOver.x);
			this.y = (1 - value) * (1 - value) * this.y + 2 * value * (1 - value) * (this.y + this.pointOver.y) / 2 + value * value * (this.pointOver.y);
		}
		/**青蛙舔到道具移动 */
		public lickProp(pointoverX: any, pointoverY: any) {
			this.canMove = false;
			//设置曲线终点--目前为直线
			this.setPoint(pointoverX, pointoverY)
			//记录自己的大小，用于落地时还原
			var sX = this.scaleX;
			var sY = this.scaleY;
			//tween动画
			egret.Tween.get(this).to({ scaleX: this.scaleX + 0.5, scaleY: this.scaleY + 0.5 }, 300).to({ scaleX: sX, scaleY: sY }, 300).call(this.callback, this);
			egret.Tween.get(this).to({ factor: 1 }, 2000)
			//锁定摇杆
			this.netrolelock();
		}
		/**tween动画回调 */
		public callback(e: egret.TouchEvent) {
			egret.Tween.removeTweens(this);
			//重置影子青蛙
			if (this.userid == DataProl.account) {
				this.OnresetShadowFogPoint(this);
			}
			this.canMove = true;
			//解锁摇杆
			this.netunrolelock();
		}
		/**锁定摇杆*/
		private netrolelock() {
			//获取当前游戏场景
			if (this.m_frogMgr.gameHandle != null && this.m_frogMgr.gameHandle != undefined) {
				var gamesence = this.m_frogMgr.gameHandle
				//获取摇杆
				if (gamesence.yaogan != null) {
					this.m_frogMgr.gameHandle.yaogan.lockControl();
				}
			}
		}
		/**解锁摇杆 */
		private netunrolelock() {
			//获取当前游戏场景
			if (this.m_frogMgr.gameHandle != null && this.m_frogMgr.gameHandle != undefined) {
				//获取摇杆
				var gamesence = this.m_frogMgr.gameHandle
				if (gamesence.yaogan != null) {
					this.m_frogMgr.gameHandle.yaogan.unlockControl();
				}
			}
		}
	}
}